using UnityEngine;

//反应状态
public class EnemyReactState : EnemyState
{
    public EnemyReactState(EnemyFSM manager, string animationName) : base(manager, animationName) { }

    public override void OnEnter()
    {
        base.OnEnter();
    }

    public override void OnUpdate()
    {
        base.OnUpdate();
        // 如果被击中标志为true，转换到受击状态
        if (parameter.isHurt)
        {
            manager.TransitionState(StateType.Hit);
        }

        // 如果动画播放进度超过95%，转换到追逐状态
        if (PlayComplete())
        {
            manager.TransitionState(StateType.Chase);
        }
    }

    public override void OnFixedUpdate()
    {
        base.OnFixedUpdate();
    }

    public override void OnExit()
    {
        base.OnExit();
    }
}

